<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport"
	content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/statics/css/sapar.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/common.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/group_ticket_list.css" />
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/statics/css/bootstrap.min.css" />
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/jquery.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/sapar.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/WdatePicker.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/statics/js/rollpage.js"></script>
<title>维修订单列表</title>
</head>
<body>
	<div id="saper-container">
		<div id="saper-hd"></div>
		<div id="saper-bd">
			<div class="subfiled clearfix">
				<h2>维修订单列表</h2>
			</div>
			<div class="subfiled-content">
				<div class="tab-container" data-trigger="click">
					<div class="tab-content">
						<div class="tab-content-item">
							<form name="f2" id="f2"
								action="${pageContext.request.contextPath }/getOrdersList.do"
								method="post">
								<div class="search-box clearfix">
									<div class="kv-item clearfix">
										<a href="#mymodal" data-toggle="modal" class="btn btn-primary">接机填单</a>
										<a href="#mymodal2" data-toggle="modal"
											class="btn btn-primary">维修</a>
									</div>
									<div class="kv-item clearfix">
										<label>订单号：</label>
										<div class="kv-item-content">
											<input type="text" placeholder="订单号" name="order_id" />
										</div>
									</div>
									<div class="kv-item clearfix">
										<label>申请时间：</label>
										<div class="kv-item-content time-select-wrap">
											<div class="time-select">
												<input type="text"
													onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
													placeholder="开始时间" /> <i class="date-icon"></i>
											</div>
											<span class="line">-</span>
											<div class="time-select">
												<input type="text"
													onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
													placeholder="结束时间" /> <i class="date-icon"></i>
											</div>
										</div>
									</div>
									<div class="kv-item clearfix">
										<label>用户：</label>
										<div class="kv-item-content">
											<input type="text" placeholder="用户" name="user_id" />
										</div>
									</div>
									<input type="submit" value="查询" />
								</div>
							</form>
							<!--表格开始-->
							<div class="table">
								<!--表格具体内容-->
								<div class="table-box">
									<table>
										<thead>
											<tr>
												<th width="20px" height="20px"><input type="checkbox"
													onchange="allCheck" /></th>
												<th>序号</th>
												<th>订单号</th>
												<th>客户姓名</th>
												<th>联系电话</th>
												<th>品牌</th>
												<th>颜色</th>
												<th>维修人</th>
												<th>维修费用</th>
												<th>维修状态</th>
												<th>付款状态</th>
												<th>付款方式</th>
												<th>接单人</th>
												<th>是否审核</th>
												<th>所属店铺</th>
												<th>状态</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<tr>
												<td width="20px" height="20px"><input type="checkbox"
													name="idbox" id="idbox" value="${lists.order_id}" /></td>
												<td>1</td>
												<td><a
													href="${pageContext.request.contextPath }/printer.do">2010309134323</a></td>
												<td>于小沫</td>
												<td>13589344332</td>
												<td>OPPO</td>
												<td>红色</td>
												<td>1</td>
												<td>255</td>
												<td>已维修</td>
												<td>已付款</td>
												<td>微信</td>
												<td>曹斯</td>
												<td>已审核</td>
												<td>好易修</td>
												<td>启用</td>
												<td><a href="#">修改</a></td>
											</tr>
											<c:forEach items="${ordersList}" var="lists" varStatus="sta">
												<tr
													${sta.index%2!=0?'style="background-color: #EFF6FA;"':''}>
													<td width="20px" height="20px"><input type="checkbox"
														name="idbox" id="idbox" value="${lists.order_id}" /></td>
													<td>${sta.index+1}</td>
													<td><a
														href="${pageContext.request.contextPath }/printer.do">${lists.order_id}</a></td>
													<td>${lists.customer_name}</td>
													<td>${lists.customer_telephone}</td>
													<td>${lists.productfaulttype_id}</td>
													<td>${lists.product_color}</td>
													<td>${lists.order_repaier}</td>
													<td>${lists.order_paymoney}</td>
													<td>未维修</td>
													<td>未付款</td>
													<td>${lists.pay_type}</td>
													<td>${lists.user_id}</td>
													<td><c:if test="${lists.isCheck eq 0}">未检测</c:if> <c:if
															test="${lists.isCheck eq 1}">已检测</c:if></td>
													<td>${lists.store_id}</td>
													<td><c:if test="${lists.order_status eq 0}">启用</c:if>
														<c:if test="${lists.order_status eq 1}">禁用</c:if></td>
													<td><a
														href="${pageContext.request.contextPath }/getOrdersId.do?order_id=${lists.order_id}">修改</a>
														<%-- <a
														href="${pageContext.request.contextPath }/deleteOrder.do?order_id=${lists.order_id}">删除</a> --%></td>
												</tr>
											</c:forEach>
											<tr>
												<td colspan="19">
													<div align="right">
														<span>共${pages.totalCount }条记录${pages.currentPageNo}/${pages.totalPageCount }页</span>
														<c:if test="${pages.currentPageNo > 1}">
															<a href="javascript:page_nav(document.forms[0],1);">首页</a>
															<a
																href="javascript:page_nav(document.forms[0],${pages.currentPageNo-1});">上一页</a>
														</c:if>
														<c:if
															test="${pages.currentPageNo < pages.totalPageCount }">
															<a
																href="javascript:page_nav(document.forms[0],${pages.currentPageNo+1 });">下一页</a>
															<a
																href="javascript:page_nav(document.forms[0],${pages.totalPageCount });">最后一页</a>
														</c:if>
													</div>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
							<!--表格结束-->
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="saper-ft"></div>
	</div>

	<!--弹出的模态框-->
	<div id="mymodal" class="modal fade">
		<!-- modal固定布局，上下左右都是0表示充满全屏，支持移动设备上使用触摸方式进行滚动。。-->
		<div class="modal-dialog modal-lg">
			<!-- modal-dialog默认相对定位，自适应宽度，大于768px时宽度600，居中-->
			<div class="modal-content">
				<form action="${pageContext.request.contextPath}/addOrders.do"
					method="post">
					<!-- modal-content模态框的边框、边距、背景色、阴影效果。-->
					<div class="modal-header">
						<button class="close" data-dismiss="modal">&times;</button>
						<center>
							<h3 class="modal-title">接机填单</h3>
						</center>
					</div>
					<div></div>
					<div class="media-body">
						<div class="addjiejidan">
							<center>
								<table bordercolor="lightgray" border="2">
									<tr align="right">
										<td>客户姓名</td>
										<td><input type="text" class="form-control"
											name="customer_name" /></td>
										<!-- <td>订单产品</td>
										<td><input type="text" class="form-control"
											name="product_name" /></td> -->
										<td>联系电话</td>
										<td><input type="text" class="form-control"
											name="customer_telephone" /></td>
										<td>产品品牌</td>
										<td><select class="form-control" name="productbrand_id">
												<option value="-1">请选择</option>
												<option value="0">OPPO</option>
												<option value="1">VIVO</option>
												<option value="2">小米</option>
										</select></td>
									</tr>
									<tr align="right">
										<td>产品颜色</td>
										<td><input type="text" class="form-control"
											name="product_color" /></td>
										<!-- <td>地址</td>
										<td><input type="text" class="form-control"
											name="pay_type" /></td> -->
										<!--<td>型号</td>
										<td><select class="form-control">
												<option value="-1">请选择</option>
												<option value="0">X6</option>
												<option value="1">X7 plus</option>
												<option value="2">其它型号</option>
										</select></td> -->
										<td>故障现象</td>
										<td><select class="form-control"
											name="productfaulttype_id">
												<option value="-1">请选择</option>
												<option value="1">屏幕问题</option>
												<option value="2">主板问题</option>
												<option value="3">按键问题</option>
												<option value="4">其他故障</option>
										</select></td>
										<td>维修人员</td>
										<td><select class="form-control" name="order_repaier">
												<option value="-1">请选择</option>
												<option value="0">李师傅</option>
												<option value="1">黄师傅</option>
												<option value="2">宋师傅</option>
										</select></td>
									</tr>
									<tr>
										<!-- <td>创建时间</td>
										<td>
											<div class="time-select">
												<input type="text" class="form-control"
													onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
													placeholder="开始时间" name="order_createtime" /> <i
													class="date-icon"></i>
											</div>
										</td> -->
										<td>客服人员</td>
										<td><select class="form-control" name="user_id">
												<option value="-1">请选择</option>
												<option value="0">李小飞</option>
												<option value="1">黄小琥</option>
												<option value="2">宋晓江</option>
												<option value="3">其他客服</option>
										</select></td>
										<!-- <td>是否付款</td>
										<td><select class="form-control" name="isCheck">
												<option value="-1">请选择</option>
												<option value="0">已付款</option>
												<option value="1">未付款</option>
										</select></td> -->
										<td>所属店铺</td>
										<td><select class="form-control" name="store_id">
												<option value="-1">请选择</option>
												<option value="1">好易修</option>
												<option value="2">修屏哥</option>
										</select></td>
										<td>状态</td>
										<td><select class="form-control" name="order_status">
												<option value="-1">请选择</option>
												<option value="0">启用</option>
												<option value="1">禁用</option>
										</select></td>
									</tr>
									<tr>
										<td>备注</td>
										<td colspan="9"><textarea class="form-control"
												name="order_remark">
										</textarea></td>
									</tr>
								</table>
							</center>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn btn-default" data-dismiss="modal">关闭</button>
						<input type="submit" value="新增" class="btn btn-primary" />
					</div>
				</form>
			</div>
		</div>

	</div>

	<!--弹出的模态框-->
	<div id="mymodal2" class="modal fade">
		<!-- modal固定布局，上下左右都是0表示充满全屏，支持移动设备上使用触摸方式进行滚动。。-->
		<div class="modal-dialog modal-lg">
			<!-- modal-dialog默认相对定位，自适应宽度，大于768px时宽度600，居中-->
			<div class="modal-content">
				<form action="${pageContext.request.contextPath }/updateRepair.do" method="post" enctype="multipart/form-data">
					<!-- modal-content模态框的边框、边距、背景色、阴影效果。-->
					<div class="modal-header">
						<button class="close" data-dismiss="modal">&times;</button>
						<center>
							<h3 class="modal-title">维修订单</h3>
						</center>
					</div>
					<div class="media-body">
						<div class="addjiejidan">
							<center>
							<input type="hidden" value="${orders.order_id}" name="order_id"/>
								<table bordercolor="lightgray" border="2">
									<tr align="right">
										<td>检测状态</td>
										<td><select class="form-control" name="isCheck">
												<option value="0" <c:if test="${orders.isCheck eq 0}"> selected=selected</c:if>>未检测</option>
												<option value="1" <c:if test="${orders.isCheck eq 1}"> selected=selected</c:if>>检测中</option>
												<option value="2" <c:if test="${orders.isCheck eq 2}"> selected=selected</c:if>>已检测</option>
										</select></td>
										<td>报价</td>
										<td><input type="text" class="form-control" name="order_paymoney" value="${orders.order_paymoney}"/></td>
										<td>维修配件</td>
										<td><select class="form-control" name="productfaulttype_id">
												<option value="0" <c:if test="${orders.productfaulttype_id eq 0}"> selected=selected</c:if>>屏幕</option>
												<option value="1" <c:if test="${orders.productfaulttype_id eq 1}"> selected=selected</c:if>>后盖</option>
												<option value="2" <c:if test="${orders.productfaulttype_id eq 2}"> selected=selected</c:if>>其他</option>
										</select></td>
									</tr>
									<tr align="right">
										<td>保修期限</td>
										<td><select class="form-control" name="repaier_date">
									        	<option value="30" <c:if test="${orders.repaier_date eq 0}"> selected=selected</c:if>>1个月</option>
												<option value="60" <c:if test="${orders.repaier_date eq 1}"> selected=selected</c:if>>2个月</option>
												<option value="90" <c:if test="${orders.repaier_date eq 2}"> selected=selected</c:if>>3个月</option>
										</select></td>
									</tr>
									<tr align="right">
										<td>结算方式</td>
										<td><input type="text" class="form-control" name="pay_type" value="${orders.pay_type}"/></td>
										<td>维修状态</td>
										<td><select class="form-control" name="repaier_status">
												<option value="0" <c:if test="${orders.repaier_status eq 0}"> selected=selected</c:if>>未维修</option>
												<option value="1" <c:if test="${orders.repaier_status eq 1}"> selected=selected</c:if>>维修中</option>
												<option value="2" <c:if test="${orders.repaier_status eq 2}"> selected=selected</c:if>>已维修</option>
										</select></td>
										<td>取机类别</td>
										<td><select class="form-control" name="isTake">
												<option value="0" <c:if test="${orders.isTake eq 0}"> selected=selected</c:if>>未取机</option>
												<option value="1" <c:if test="${orders.isTake eq 1}"> selected=selected</c:if>>已取机</option>
										</select></td>
									</tr>
									<tr>
										<td>维修人员</td>
										<td><input type="text" class="form-control" name="order_repaier" value="${orders.order_repaier}"/></td>
										<!-- <td>出库类型</td>
										<td><select class="form-control">
												<option value="-1">请选择</option>
												<option value="0">维修出库</option>
												<option value="1">销售出库</option>
												<option value="3">调配出库</option>
										</select></td> -->
									</tr>
									<tr>
										<td>备注</td>
										<td colspan="9"><input type="text" class="form-control" name="order_remark" value="${orders.order_remark}"/></td>
									</tr>
								</table>
							</center>
						</div>
					</div>
					<div class="modal-footer">
						<button class="btn btn-default" data-dismiss="modal">关闭</button>
						<input type="submit" value="修改" class="btn btn-primary" />
					</div>
				</form>
			</div>
		</div>
	</div>
	<script type="text/javascript"
		src='${pageContext.request.contextPath }/statics/js/jquery-1.12.4.js'></script>
	<script type="text/javascript"
		src='${pageContext.request.contextPath }/statics/js/bootstrap.js'></script>
	<script type="text/javascript">
		$('select').iSelect();
		/*		$('.modal').modal();*/
	</script>
</body>
</html>